<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateLianjiaCommunityListTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('lianjia_community_list', function (Blueprint $table) {
            $table->id();
            $table->string('province', 24)->default('')->comment('省');
            $table->string('city', 24)->default('')->comment('市');
            $table->string('district', 24)->default('')->comment('区');
            $table->string('cityCode', 6)->default('')->comment('citycode');
            $table->string('level', 12)->default('')->comment('等级');
            $table->string('fullSpell', 36)->default('')->comment('');
            $table->string('desc', 120)->default('')->comment('描述');
            $table->unsignedInteger('count')->default(0)->comment('套');
            $table->string('countStr', 10)->default('')->comment('套');
            $table->decimal('price')->default(0)->comment('平均价格');
            $table->string('priceStr', 12)->default('')->comment('平均价格');
            $table->string('priceUnit', 4)->default('')->comment('价格单位');
            $table->text('border')->nullable()->comment('边界');
            $table->string('bubbleDesc', 24)->default('')->comment('气泡描述');
            $table->string('icon', 124)->default('')->comment('icon');
            $table->string('entityId', 36)->default('')->comment('实体ID');
            $table->string('entityType', 36)->default('')->comment('实体类型');
            $table->string('communityId', 36)->default('')->comment('小区id');
            $table->string('name', 36)->default('')->comment('name');
            $table->decimal('lng', 14, 11)->default(0)->comment('lng');
            $table->decimal('lat', 14,11)->default(0)->comment('lat');
            $table->string('imageType', 12)->default('')->comment('imageType');
            $table->unsignedTinyInteger('selected')->default(0)->comment('selected');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = 'LianJia小区列表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('lianjia_community_list');
    }
}
